<?php echo $this->Html->script(array('print')); ?>

<div class="page-header">
                    <div class="icon">
                        <span class="ico-layout-7"></span>
                    </div>
                    <h1>Recargas <small>Listado de recargas</small></h1>
                </div>
<div class="row-fluid">
    <div class="span8">
    <div class="block">
                            <div class="head dblue">
                                <div class="icon"><span class="ico-layout-9"></span></div>
                                <h2>Recargas De Hoy <?php echo date('d-m-Y');?></h2>
                                <ul class="buttons">
                                    <li><a href="#" onClick="source('table_sort_pagination'); return false;"><div class="icon"><span class="ico-info"></span></div></a></li>
                                </ul>                                                        
                            </div>  
                                          
       <div id="areaImprimir">
        <table width="767" border="1" cellspacing="2" cellpadding="2">
  <tr>
    <td><p>NOMBRE DE LA EMPRESA</p>
    <p>XXXXXXXXXXXXXXXXXXXXXX</p></td>
    <td align="center">FACTURA</td>
    <td><p>NIT: 8888888888</p>
    <p>FACTURA</p>
    <p>N: <?php echo $numero_factura?></p>
    <p>AUTORIZACION <?php echo $autorizacion?></p>
    <p>Codigo de Control: <?php echo $codigo_control?></p>
    </td>
  </tr>
  <tr>
    <td colspan="3"><p>LA PAZ <?php echo date('d')?> DE <?php echo date('m')?> DE 20<?php echo date('y')?></p>
    <p>SENORES: <?php echo $this->Session->read('Auth.User.nombre');?>....NIT/CI: <?php echo $nit?></p></td>
  </tr>
  <tr>
    <td colspan="3"><table width="750" border="1" cellspacing="2" cellpadding="2">
      <tr>
        <td width="122">CANTIDAD</td>
        <td width="398">DETALLE</td>
        <td width="202">IMPOTE</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>TOTAL BS.</td>
        <td><?php echo $monto;?></td>
      </tr>
      <tr>
        <td colspan="3">SON: <?php echo $monto_letras?>BOLIVIANOS</td>
        </tr>
    </table></td>
  </tr>
</table>
       </div>                         
    </div> 
    </div>
</div>



<table>
    <tr>
        <td> 
        <a class="buttonM bBlack" href="#" id="btnImprimir">IMPRIMIR</a>
        </td>
        <td><?php echo $this->Html->link('ATRAS',array('controller'=>'Tubos','action' => 'verdetalle',$idTubo),array('class'=>'buttonM bGreen'))?></td>
        
        
    </tr>

</table>
<script type="text/javascript">

    $(document).ready(function() {

        $("#btnImprimir").click(function() {
            //console.log('click');
            printElem({
                leaveOpen: true,
                printMode: 'popup',
                overrideElementCSS: [
                    '<?php echo $this->webroot; ?>css/imprimir.css',
                    {href: '<?php echo $this->webroot; ?>css/imprimir.css', media: 'print'}]
            });
            //printElem({ overrideElementCSS: ['http://www.imprenta.com/css/printable.css'] });
        });

    });
    function printElem(options) {
        $('#areaImprimir').printElement(options);
    }
</script>